/**
 * Panel permettant d'afficher une image de fond
 * 
 * @author Marie-Hélène Goddet, Damien Finck, Cédric Schaller
 * 
 */

package gui;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;

import javax.swing.JPanel;

@SuppressWarnings("serial")
public class JPanelBackground extends JPanel {
	Image backGround=null;
	/**
	 * Constructeur
	 * @param layout le layout du panel
	 * @param img l'image de fond
	 */
	public JPanelBackground(LayoutManager layout,Image img) {
		this.backGround=img;
		this.setOpaque(false);
		this.setLayout(layout);
	}
	public void paint(Graphics g) {
		if (backGround!=null)
			g.drawImage(backGround,0,0,getSize().width,getSize().height,this);
		super.paint(g);
	}
}